import request from './request'

export const UserUpdateById = (userBody) => {
  return request({
    url: '/staff/update',
    method: 'PUT',
    data: userBody
  })
}

export const UserFind = (body) => {
  return request({
    url: 'staff/find',
    method: 'POST',
    data: body
  })
}

export const UserAdd = (body) => {
  return request({
    url: 'staff/add',
    method: 'POST',
    headers: {
      token: localStorage.getItem('token') || ''
    },
    data: body
  })
}

export const getStaff = (page, limit, data) => {
  // console.log(data)
  return request({
    url: `/staff/paging/${page}/${limit}`,
    method: 'POST',
    headers: {
      token: localStorage.getItem('token') || ''
    },
    data
  })
}
export const deleteStaff = (staffid) => {
  return request({
    url: `/staff/delete/${staffid}`,
    method: 'DELETE',
    headers: {
      token: localStorage.getItem('token') || ''
    }
  })
}
